-- card: 30467 from stack: in.2r -- bmap block id: 0 -- flags: 0000 -- background id: 2612 -- name: BarButton -- part 2 (button) -- low flags: 00 -- high flags: 0002 -- rect: left=320 top=234 right=296 bottom=350 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: click in me ----- HyperTalk script ----- on mousedown if the optionkey is down then edit script of me set cursor to 2 get the rect of me barbutton end mousedown -- part 3 (button) -- low flags: 00 -- high flags: 0002 -- rect: left=355 top=270 right=295 bottom=470 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: me too ----- HyperTalk script ----- on mousedown if the optionkey is down then edit script of me set cursor to 2 get the rect of me barbutton end mousedown -- part contents for background part 2 ----- text ----- BarButton -- part contents for background part 3 ----- text ----- The "Bar button" is an easy way for the HyperCard author to ask for numeric values. It is an XCMD which works a bit like a scroll bar, but you can choose the height, width and direction the bar moves. You may also specify the range of acceptable values (more on that later.) Over to the right are two simple Bar buttons. When you click inside a button, the cursor changes to a thin cross, and the bar moves up to the cursor. When you release the mouse button, the "value" of the cursor position is returned in "the result". Note that the two buttons' scripts are identical, even though one bar moves bottom to top and the other left to right. The Bar button automatically operates bottom to top if the button's rectangle is taller than it is wide. Try changing the size or shape of the buttons. They can be any size, even the whole width of the screen. If you include at least two parameters,BarButton will normally display the current numeric value as you change the size of the bar. The value is always displayed to the right of left&right Bar buttons, and below the up&down Bar buttons. You can issue the "BarButton" command at any time; you're not limited to just when a user clicks in the button. A Public Domain XCMD for Hypercard written by Lloyd Maxfield Infosynthesis 2960 Ferry Street Eugene, OR 97405 (503) 344-3322 -- part contents for background part 10 ----- text ----- Syntax: BarButton [direction][,maximum][,minimum][,default value] You may optionally include up to four parameters after the BarButton command. The first parameter tells the XCMD to operate the bar in a particular direction: 1: left to right 2: right to left 3: bottom to top 4: top to bottom Using the negatives of these numbers will suppress the numeric value display when specifying the second and third parameters. The second and third parameters after the BarButton command tell the XCMD the range of values you allow. The second parameter is the maximum, and the third is the minimum. If the third parameter is absent, zero is assumed. All values must be integers. The fourth parameter is used when you wish to force an initial value without requiring that the user click in the button. When you supply this fourth parameter, BarButton displays the initial value and immediately returns, without even looking at the mouse location. -- part contents for background part 13 ----- text ----- 24